package com.atguigu.juc.study.chapter03.cf.otherapi;

import java.util.concurrent.CompletableFuture;

/**
 * @author : leimingchao
 * @date Date : 2022年06月11日 22:07
 */
public class CompletableFutureAPIDemo5 {

    public static void main(String[] args) {

        System.out.println(CompletableFuture.supplyAsync(() -> "resultA").thenRun(() -> System.out.println("11111111")).join());
        System.out.println(">>>>>>>>>>>>>>>>>>");
        System.out.println(CompletableFuture.supplyAsync(() -> "resultA").thenAccept(System.out::println).join());
        System.out.println(">>>>>>>>>>>>>>>>>>");
        System.out.println(CompletableFuture.supplyAsync(() -> "resultA").thenApply(r -> r + " resultB").join());


    }
}
